package com.gongj.main;

import com.gongj.DefaultListableBeanFactory.Person;
import com.gongj.bean.User;
import org.springframework.beans.factory.support.DefaultListableBeanFactory;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.core.io.ClassPathResource;

public class FactoryMethodMain {
	//测试FactoryMethod中的方法
	public static void main(String[] args) {
		ClassPathXmlApplicationContext cxt = new ClassPathXmlApplicationContext("factoryMethod.xml");
		Object aFactory = cxt.getBean("aFactory");
		System.out.println("结果：" +aFactory);
		Object a = cxt.getBean("aFactory");
		System.out.println("结果：" +a);

	/*	Object a = cxt.getBean("a");
		System.out.println("结果：" +a);

		Object a2 = cxt.getBean("a");
		System.out.println("结果：" +a2);*/
	}
}
